<?php

namespace app\ruinuo\config\form;
use app\common\model\RuinuoForm as DataMode;
class Info
{
    public function Model()
    {
        return new DataMode();
    }

    public function ListModel()
    {
        $Model=new DataMode();
        $DB=$Model->alias('a');
        return $DB;
    }

    public function InfoMode()
    {
        $data=[
            'app_id'=>'1',
            'app_num'=>'ruinuo',
            'app_name'=>'低代码',
            'mode_id'=>'3',
            'mode_num'=>'form',
            'mode_name'=>'表单管理',
            'database'=>'ruinuo_form',
            'sub_database'=>[],        ];
        return $data;
    }

    public function InfoForm()
    {
        $data=[
            'power_field'=>[],
            'layout'=>[
                [
                    'field'=>'width',
                    'title'=>'弹窗宽度',
                    'value'=>'0',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'isinteger',
                ],
                [
                    'field'=>'height',
                    'title'=>'弹窗高度',
                    'value'=>'0',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'isinteger',
                ],
                [
                    'field'=>'form_label',
                    'title'=>'标题对齐',
                    'value'=>'form_right',
                    'tag'=>'select',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'',
                    'options_num'=>'label_type',
                ],
                [
                    'field'=>'label_width',
                    'title'=>'标题宽度',
                    'value'=>'0',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'isinteger',
                ],
                [
                    'field'=>'power_field',
                    'title'=>'字段权限',
                    'value'=>'',
                    'tag'=>'jsontable',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                    'cols'=>[
                [
                    'field'=>'field',
                    'title'=>'字段',
                    'update'=>'input',
                    'options'=>'',
                    'minWidth'=>'160',
                    'required'=>'1',
                ],
                [
                    'field'=>'add',
                    'title'=>'不可新增',
                    'width'=>'90',
                    'update'=>'switch',
                    'minWidth'=>'90',
                ],
                [
                    'field'=>'edit',
                    'title'=>'不可编辑',
                    'width'=>'90',
                    'update'=>'switch',
                    'options'=>'',
                    'minWidth'=>'90',
                ],
                [
                    'field'=>'detail',
                    'title'=>'不可查看',
                    'width'=>'90',
                    'update'=>'switch',
                    'minWidth'=>'90',
                ],
                [
                    'field'=>'user_ids',
                    'title'=>'用户授权',
                    'update'=>'select',
                    'options'=>'admin_user_list',
                    'minWidth'=>'160',
                ],
                [
                    'field'=>'role_ids',
                    'title'=>'角色授权',
                    'update'=>'select',
                    'options'=>'admin_role',
                    'minWidth'=>'160',
                ],
                [
                    'field'=>'department_ids',
                    'title'=>'组织授权',
                    'update'=>'select',
                    'options'=>'department_list',
                    'minWidth'=>'160',
                ],
            ],

                ],
            ],
        ];
        return $data;
    }

    public function InfoLists()
    {
        $data=[
            'lists'=>[
                [
                    'name'=>'全部',
                    'num'=>'m_1713360218',
                    'page_num'=>'30',
                    'order_raw'=>'id desc',
                    'power_field'=>[],
                    'power_role'=>'',
                    'power_department'=>'',
                    'set_where'=>'',
                    'table_cols'=>[
                [
                    'field'=>'id',
                    'title'=>'主键',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
            ],

                ],
            ],
        ];
        return !empty($data['lists']) ? $data['lists'] : [];
    }

}